package controller.data.editDocumentation;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import controller.data.EditDocumentationRevision;

public class EditDocumentationRequest {
	private EditDocumentationRevision revision;
	private String id;
	private List<String> tags;

	public EditDocumentationRequest(String id, EditDocumentationRevision revision,
			List<String> tags) {
		this.id = id;
		this.revision = revision;
		this.tags = new ArrayList<String>();
		setTags(tags);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public EditDocumentationRevision getRevision() {
		return revision;
	}

	public void setRevision(EditDocumentationRevision revision) {
		this.revision = revision;
	}

	public void setTags(List<String> tags) {
		Set<String> tmp = new HashSet<String>();
		for (String s : tags) {
			if (s.compareTo("") != 0) {
				tmp.add(s.toLowerCase());
			}
		}
		this.tags = new ArrayList<String>(tmp);
	}

	public List<String> getTags() {
		return tags;
	}
}
